Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize translation prompts #126

Merged

Conversation

MilesHan
Copy link
Contributor

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • โœจ feat
  • ๐Ÿ› fix
  • โ™ป๏ธ refactor
  • ๐Ÿ’„ style
  • ๐Ÿ”จ chore
  • ๐Ÿ“ docs

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

  1. Optimize the JSON translation prompt to maintain the JSON format of the translation results
  2. Updated JSON example to add JSON array

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

#100

I reproduced the issue above. For example, when I use the original prompt to translate the example en_US.json I gave, it will appear stably ... is not valid JSON
image

After add Do not include any additional text or explanations outside the JSON object.Start directly with a left brace and end with a right brace.๏ผŒI tested several complex nested JSON files and all of them were translated stably.

@lobehubbot
Copy link
Member

๐Ÿ‘ @MilesHan

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚
ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

@kiwiflydream
Copy link

ๆ„Ÿ่ฐข๏ผŒๆˆ‘ๆŠŠไฝ ็š„ๆ็คบ่ฏญๆ”พๅˆฐ reference ๅŽ๏ผŒๅฐฑๆžๅฐ‘ๅ‡บ็Žฐ็ฑปไผผ็š„้”™่ฏฏไบ†ใ€‚

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Thanks, after I put your prompt in reference, similar errors rarely occur.

@canisminor1990 canisminor1990 merged commit 12520fe into lobehub:master Sep 13, 2024
2 checks passed
@lobehubbot
Copy link
Member

โค๏ธ Great PR @MilesHan โค๏ธ

The growth of project is inseparable from user feedback and contribution, thanks for your contribution!
้กน็›ฎ็š„ๆˆ้•ฟ็ฆปไธๅผ€็”จๆˆทๅ้ฆˆๅ’Œ่ดก็Œฎ๏ผŒๆ„Ÿ่ฐขๆ‚จ็š„่ดก็Œฎ!

@lobehubbot
Copy link
Member

๐ŸŽ‰ This PR is included in version 1.20.0 ๐ŸŽ‰

The release is available on npm package (@latest dist-tag)

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@lobehubbot
Copy link
Member

๐ŸŽ‰ This PR is included in version 2.15.2 ๐ŸŽ‰

The release is available on npm package (@latest dist-tag)

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants